package com.example.applications.Kotlin


fun main() {
    val student1 = Student1()
    student1.tellAge()
    println(student1)

    val student2 = student2(18, "小猫")
    student2.tellAge()
    println(student2)

}

interface Person {
    var age: Int
    var name: String
    fun tellAge()
}

class Student1 : Person {
    override var age: Int = 18
    override var name: String = "小猫"
    override fun tellAge() {
        println("年龄是：$age")
    }
}

data class student2(override var age: Int, override var name: String) : Person {
    override fun tellAge() {
        println("年龄是：$age")
    }
}
